package org.linlinjava.litemall.db.service;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.dao.DeviceMapper;
import org.linlinjava.litemall.db.domain.Device;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class DeviceService {

    @Autowired
    private DeviceMapper deviceMapper;

    public int saveDevice(Device device) {
        return deviceMapper.insert(device);
    }

    public List<Device> selectAll() {
        return deviceMapper.selectAll();
    }

    public Device getDeviceId(Long id) {
        return deviceMapper.selectById(id);
    }

    public List<Device> selectByConditions(String deviceIdentification, String connectStatus){
        return deviceMapper.selectByConditions(deviceIdentification,connectStatus);
    }
}
